package com.cloud.rou.im.core.util;

import com.cloud.rou.im.core.base.ResultVO;
import com.sun.xml.internal.ws.api.message.Packet;
import io.netty.util.concurrent.*;

import java.util.concurrent.Executors;
import java.util.concurrent.ThreadFactory;

/**
 * <p></p>
 *
 * @author GaoShuangWen
 * @since 2019-10-31 14:12
 */
public class TestEventExecutor extends SingleThreadEventExecutor {
    public TestEventExecutor() {
        super(null, Executors.defaultThreadFactory(), true);
    }

    @Override
    protected void run() {
        for (;;) {
            Runnable task = takeTask();
            if (task != null) {
                task.run();
                updateLastExecutionTime();
            }

            if (confirmShutdown()) {
                break;
            }
        }
    }


}
